<?php 
$sql =	"SELECT
			  c.page_id,
			  d.title,
			  d.description,
			  d.meta_key,
			  d.meta_description	
		  FROM
			  pages AS c,
			  page_description AS d,
			  sef_url AS s
		  WHERE
		  
			  c.page_id = d.page_id
			  AND
			  d.lang_id = '".$_SESSION['lang_id']."'
			  
			  AND
				c.page_id = s.query
				AND
				s.lang_id = '".$_SESSION['lang_id']."'
				AND s.tamplate = 'page'
			 
			  AND
				s.sef_url = 'news' 
		  ";
$result = query($sql);
$row = mysql_fetch_object($result);


head(sth($row->title),sth($row->meta_description));

?>
<div class="loadLoader">
	
</div>
<section id="slider">

	<h1><?=stripslashes($row->title)?></h1>
    
<div class="timelineLoader">
	<img src="<?=HTML_BASE?>images/loader.gif" />
</div>
	
<div class="timeline news">
		<?php 
		
			
			 
			  $sql = "SELECT
				s.sef_url,
				c.new_id,
				c.creation_time,
				d.title,
				d.description
				
			FROM
				news AS c,
				news_description AS d,
				sef_url AS s
			WHERE
				c.new_id = d.new_id
				AND
				d.lang_id = '".$_SESSION['lang_id']."'
				AND c.published
				AND
				c.new_id = s.query
				AND
				s.lang_id = '".$_SESSION['lang_id']."'
				AND s.tamplate = 'new'
				ORDER BY c.creation_time 
			  ";
			$result = query($sql);
			
			while ($row = mysql_fetch_object($result)) {
				
				$date_name = date('d.m.Y',strtotime($row->creation_time)).' г.';
				$date_id = date('d/m/Y',strtotime($row->creation_time));
				
		?>
        
        <div class="item" data-id="<?=$date_id?>" data-name="<?=$date_name?>" data-description="<?=strip_tags(text_format($row->title, 50))?>">
			<h2><?=strip_tags(text_format($row->title, 60))?>...</h2>
            <div style="text-align:left; padding:0 10px;">
				<?=strip_tags(text_format($row->description, 500))?>...<br />
                <a href="<?=HTML_BASE.$_SESSION['lang'].'/'.$row->sef_url?>">Виж повече</a>
            </div>
		</div>
		
        
        <?php }?>

</div>

	<?=stripslashes($row->description)?>

</section>
<?php
foot();
?>